<%= form_for [:admin, @subforem] do |form| %>
  <% if current_user.any_admin? %>
    <div class="crayons-field">
      <%= form.label :domain, class: "crayons-label" %>
      <%= form.text_field :domain, class: "crayons-textfield" %>
    </div>
    
    <div class="crayons-field">
      <%= form.label :name, "Community Name", class: "crayons-label" %>
      <%= form.text_field :name, class: "crayons-textfield", placeholder: "Enter the community name" %>
    </div>
    
    <div class="crayons-field">
      <%= form.label :brain_dump, "Brain Dump", class: "crayons-label" %>
      <%= form.text_area :brain_dump, class: "crayons-textfield", rows: 4, placeholder: "Describe the community, its purpose, topics, and target audience..." %>
    </div>
    
    <div class="crayons-field">
      <%= form.label :logo_url, "Logo URL", class: "crayons-label" %>
      <%= form.text_field :logo_url, class: "crayons-textfield", placeholder: "https://example.com/logo.png" %>
    </div>
    
    <div class="crayons-field">
      <%= form.label :bg_image_url, "Background Image URL (Optional)", class: "crayons-label" %>
      <%= form.text_field :bg_image_url, class: "crayons-textfield", placeholder: "https://example.com/background.jpg" %>
    </div>
    
    <div class="crayons-field">
      <%= form.label :default_locale, "Default Language for Generated Content", class: "crayons-label" %>
      <%= form.select :default_locale, 
          options_for_select([
            ['English', 'en'],
            ['Portuguese (Brazilian)', 'pt'],
            ['French', 'fr']
          ], @subforem.default_locale || 'en'),
          { prompt: 'Select the language for generated content' },
          { class: "crayons-select" } %>
      <small class="crayons-field__description">
        This will determine the language of all AI-generated content (descriptions, tags, about page, etc.)
      </small>
    </div>
  <% end %>
  
  <div class="crayons-field">
    <%= form.label :discoverable, class: "crayons-label" %>
    <%= form.check_box :discoverable, class: "crayons-checkbox" %>
  </div>

  <% if @subforem.persisted? %>
    <div class="crayons-field">
      <%= form.label :community_description, "Community Description", class: "crayons-label" %>
      <%= text_area_tag :community_description, 
          Settings::Community.community_description(subforem_id: @subforem.id), 
          class: "crayons-textfield", 
          rows: 4, 
          placeholder: "Describe your community..." %>
    </div>

    <div class="crayons-field">
      <%= form.label :tagline, "Tagline", class: "crayons-label" %>
      <%= text_field_tag :tagline, 
          Settings::Community.tagline(subforem_id: @subforem.id), 
          class: "crayons-textfield", 
          placeholder: "A short tagline for your community..." %>
    </div>

    <div class="crayons-field">
      <%= form.label :member_label, "Member Label", class: "crayons-label" %>
      <%= text_field_tag :member_label, 
          Settings::Community.member_label(subforem_id: @subforem.id), 
          class: "crayons-textfield", 
          placeholder: "e.g., user, member, developer..." %>
    </div>
  <% end %>
  
  <div>
    <%= form.submit class: "c-btn c-btn--primary" %>
  </div>
<% end %>